package pers.xukai.common.controller;

import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import pers.xukai.common.constant.response.ResponseResult;
import pers.xukai.common.entity.vo.RegisterUserVo;
import pers.xukai.common.service.UserCommonService;

@RestController
@RequestMapping("/user")
public class UserController {

    private final UserCommonService userCommonService;

    public UserController(UserCommonService userCommonService) {
        this.userCommonService = userCommonService;
    }

    /**
     * 注册用户
     * @param registerUserVo
     */
    @ApiOperation("注册用户")
    @PostMapping("/registerUser")
    public ResponseResult<Object> registerUser(@RequestBody RegisterUserVo registerUserVo){
        userCommonService.registerUser(registerUserVo);
        return ResponseResult.success();
    }
}
